using System.Globalization;
using System.Windows.Data;

namespace Koala.Pro.Helpers;

public class NullableDateTimeToCurrentDateConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is DateTime)
        {
            return value;
        }
        return DateTime.Now.Date;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return value;
    }
}
